home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Info-Mac 3
/
Info_Mac_1994-01.iso
/
Applications
/
Fractal Generator
/
Maps
/
Fractals
< prev
next >
Wrap
Text File
|
1993-06-07
|
3KB
|
104 lines
( Preset fractals module for Fractal Lab Kit, RTK, 05-18-93 )
( news words: preset, individual fractal names )
forget task : task ;
: koch ( -- ) ( load maps to generate the Koch curve )
0.333 0.0 0.0 0.333 0.0 0.0 0.25 1 set
0.167 -0.288 0.288 0.167 0.333 0.0 0.25 2 set
0.167 0.288 -0.288 0.167 0.5 0.288 0.25 3 set
.333 0. 0. .333 .667 0. .25 4 set
4 maps ;
: hindu ( -- ) ( load Hindu maps )
.5 0. 0. .48 0. 0. .32 1 set
.5 0. 0. .48 .5 0. .32 2 set
.34 0. 0. .48 .33 .52 .32 3 set
.1 0. 0. -0.1 .45 .36 .04 4 set
4 maps ;
: fern ( -- ) ( load Fern maps )
.81 .07 -0.04 .84 .12 .195 .75 1 set
.18 -0.25 .27 .23 .12 .02 .115 2 set
.19 .275 .238 -.14 .16 .12 .115 3 set
.0235 .087 .045 .1666 .11 0. .02 4 set
4 maps ;
: blocks ( -- ) ( load Blocks maps )
0. .3 .54 0. .69 .44 .21 1 set
-.65 0. 0. .41 .66 .57 .26 2 set
.24 0. 0. -.32 .33 .35 .15 3 set
.38 0. 0. .41 .6 .02 .19 4 set
-.28 0. 0. -.523 .3 .53 .19 5 set
5 maps ;
: cantor ( -- ) ( load Cantor set maps )
.33 0. 0. .33 0. .4 .5 1 set
.33 0. 0. .33 .67 .4 .5 2 set
2 maps ;
: dust ( -- ) ( load Dust maps )
.3 0. 0. .3 0. 0. .2 1 set
.3 0. 0. .3 .7 0. .2 2 set
.3 0. 0. .3 0. .7 .2 3 set
.3 0. 0. .3 .7 .7 .2 4 set
.3 0. 0. .3 .35 .35 .2 5 set
5 maps ;
: burst ( -- ) ( load Burst maps )
.3 0. .25 .1 0. .01 .12 1 set
-.3 0. -.25 -.1 .99 .99 .12 2 set
.7 .3 0. -.98 0. .99 .7 3 set
.1 -.3 .3 .1 .6 .3 .06 4 set
4 maps ;
: circles ( -- ) ( load Circle maps )
.2929 -.2929 .2929 .2929 .5 .5 .25 1 set
.2929 .2929 -.2929 .2929 .5 .5 .25 2 set
-.2929 .2929 -.2929 -.2929 .5 .5 .25 3 set
-.2929 -.2929 .2929 -.2929 .5 .5 .25 4 set
4 maps ;
: terror ( -- ) ( load Terror maps )
.3 .3 .54 0. .39 .44 .21 1 set
-.65 .2 -.1 .41 .66 .57 .26 2 set
.24 0. .2 -.32 .33 .35 .15 3 set
.38 -.1 0. .41 .6 .02 .19 4 set
-.28 0. -.1 -.523 .3 .63 .19 5 set
5 maps ;
: tree ( -- ) ( load Tree maps )
.03 0. 0. .48 -.005 0. .05 1 set
.03 0. 0. .48 .01 0. .05 2 set
.035 0. 0. -.44 .01 .21 .05 3 set
.035 0. 0. .41 -.007 .02 .05 4 set
.41 -.41 .41 .41 -.1 .23 .4 5 set
.41 .41 -.41 .41 .01 .23 .4 6 set
6 maps ;
: spiral ( -- ) ( load Spiral maps )
.96 .15 -.15 .96 -.08 .0861 .955 1 set
.11 -.05 .05 .11 1.11 .8 .045 2 set
2 maps ;
: preset ( -- ) ( Load a preset fractal map )
page cr ." Predefined fractals : " cr cr
." 1. Koch curve" cr ." 2. Hindu" cr ." 3. Fern leaf" cr
." 4. Blocks" cr ." 5. Cantor set" cr ." 6. Dust" cr
." 7. Burst" cr ." 8. Circles" cr ." 9. Terror" cr
." 10. Tree" cr ." 11. Spiral" cr cr
." Which ? " input
dup 1 = if drop koch else
dup 2 = if drop hindu else
dup 3 = if drop fern else
dup 4 = if drop blocks else
dup 5 = if drop cantor else
dup 6 = if drop dust else
dup 7 = if drop burst else
dup 8 = if drop circles else
dup 9 = if drop terror else
dup 10 = if drop tree else
11 = if spiral else ." Illegal value ! " quit
then then then then then then then then then then then
cr ." Predefined maps loaded, " nmaps @ . ." maps total." cr cr ;